<template>
  <div id="app">
    <nav>
      <router-link to="/">Home</router-link> | <router-link to="/about">About</router-link>
    </nav>
    <router-view />
    -----------------------------
    <V-share></V-share>
    -----------------------------
    <swiper :options="swiperOption" class="swiper-s">
      <swiper-slide>123</swiper-slide>
      <swiper-slide>456</swiper-slide>
      <swiper-slide>789</swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
      <div class="swiper-button-prev" slot="button-prev"></div>
      <div class="swiper-button-next" slot="button-next"></div>
    </swiper>
    ------------------------
    <h1>这是app</h1>
    <p>这是app</p>
    -----------------------
    <City></City>
  </div>
</template>
<script>
import City from "./components/City.vue";
export default {
  data() {
    return {
      swiperOption: {
        slidesPerView: 1,
        // 设置分页器
        pagination: {
          el: '.swiper-pagination',
          // 设置点击可切换
          clickable: true
        },
        // 设置前进后退按钮
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev'
        },
        // 设置自动轮播
        autoplay: {
          delay: 1000 // 5秒切换一次
        },
        // 设置轮播可循环
        loop: true
      }
    }
  },
  components:{
    City
  }
}

</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
.swiper-pagination >>> .swiper-pagination-bullet-active{
  background: red;
}
.swiper-s {
  height: 50px;
}

